<?php

class openapi_api_params_v1_business extends openapi_api_params_abstract implements openapi_api_params_interface{

    public function checkParams($method,$params,&$sub_msg,$defined_params=array(),$dataType='kv'){
        if(parent::checkParams($method,$params,$sub_msg,$defined_params,$dataType)){
            return true;
        }else{
            return false;
        }
    }

    public function getAppParams($method){
        $params = array(
            'goods_order_list'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'name' => array('required'=>'false','type'=>'string','name'=>'商品名称'),
                'bn' => array('required'=>'false','type'=>'string','name'=>'商品编号'),
                'hide_no_store' => array('required'=>'false','type'=>'string','name'=>'隐藏上级零库存商品'),
                'nPage' => array('required'=>'false','type'=>'int','name'=>'页码'),
            ),
            'substore_purchase_scope'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'substore_id'=>array('required'=>'false','type'=>'int','name'=>'下级经销商ID'),
                'nPage' => array('required'=>'false','type'=>'int','name'=>'页码'),
            ),
            'divideShop'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'substore_id'=>array('required'=>'true','type'=>'int','name'=>'下级经销商ID'),
                'goods_ids'=>array('required'=>'true','type'=>'json','name'=>'授权商品ID',
                    'items'=>array(
                        'goods_id'=>array('required'=>'true','type'=>'string','name'=>'商品ID'),
                    ),
                ),
            ),
            'godelivery'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'order_id'=>array('required'=>'true','type'=>'string','name'=>'订单ID'),
            ),
            'dodelivery'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'order_id'=>array('required'=>'true','type'=>'string','name'=>'订单ID'),
                'send_items'=>array('required'=>'true','type'=>'json','name'=>'发货列表',
                    'items'=>array(
                        'item_id'=>array('required'=>'true','type'=>'int','name'=>'发货货品标识'),
                        'sendnum'=>array('required'=>'true','type'=>'string','name'=>'发货货品数量'),
                    ),
                ),
                'cost_freight'=>array('required'=>'true','type'=>'string','name'=>'邮费'),
                'ship_name'=>array('required'=>'true','type'=>'string','name'=>'收货人姓名'),
                'ship_tel'=>array('required'=>'false','type'=>'string','name'=>'收货人电话'),
                'ship_mobile'=>array('required'=>'true','type'=>'string','name'=>'收货人手机号'),
                'ship_zip'=>array('required'=>'false','type'=>'string','name'=>'收货地邮编'),
                'ship_area'=>array('required'=>'true','type'=>'string','name'=>'收货人区域'),
                'ship_addr'=>array('required'=>'true','type'=>'string','name'=>'收货人地址'),
                'memo'=>array('required'=>'false','type'=>'string','name'=>'买家留言'),
                'logi_id'=>array('required'=>'true','type'=>'string','name'=>'选择的快递ID'),
                'logi_no'=>array('required'=>'true','type'=>'string','name'=>'快递单号'),
            ),
            'substore_purchase_price'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'svalue' => array('required'=>'false','type'=>'string','name'=>'商品名称或编号'),
                'nPage' => array('required'=>'false','type'=>'int','name'=>'页码'),
            ),
            'set_substore_purchase_price'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'price'=>array('required'=>'true','type'=>'json','name'=>'货品数组',
                    'items'=>array(
                        'product_id'=>array('required'=>'true','type'=>'string','name'=>'货品ID'),
                        'grade_id'=>array('required'=>'true','type'=>'string','name'=>'经销商等级'),
                        'price'=>array('required'=>'true','type'=>'string','name'=>'采购价'),
                    ),
                ),
            ),
            'substore_approve_list'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'store_name' => array('required'=>'false','type'=>'string','name'=>'经销商名称'),
                'nPage' => array('required'=>'false','type'=>'int','name'=>'页码'),
            ),
            'substore_approve_detail'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'store_id' => array('required'=>'true','type'=>'string','name'=>'经销商id'),
            ),
            'substore_approve'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'store_id' => array('required'=>'true','type'=>'string','name'=>'经销商id'),
                'last_time' => array('required'=>'true','type'=>'string','name'=>'有效期'),
                'certification_uname' => array('required'=>'false','type'=>'string','name'=>'实名认证'),
                'certification_ushop' => array('required'=>'false','type'=>'string','name'=>'实体店铺认证'),
                'status' => array('required'=>'true','type'=>'string','name'=>'开启状态'),
                'approved' => array('required'=>'true','type'=>'string','name'=>'审核状态'),
                'approvedremark' => array('required'=>'false','type'=>'string','name'=>'审核备注'),
                'remark' => array('required'=>'false','type'=>'string','name'=>'经销商备注'),
            ),
            'order_to_ship'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'nPage' => array('required'=>'false','type'=>'int','name'=>'页码'),
            ),
            'order_nopayed'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'nPage' => array('required'=>'false','type'=>'int','name'=>'页码'),
            ),
            'order_docancel'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'order_id' => array('required'=>'true','type'=>'string','name'=>'订单ID'),
            ),
            'change_price_before'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'order_id' => array('required'=>'true','type'=>'int','name'=>'订单ID'),
            ),
            'change_price'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'order_id' => array('required'=>'true','type'=>'int','name'=>'订单ID'),
                'final_amount' => array('required'=>'true','type'=>'string','name'=>'卖家修改后的金额'),
            ),
            'goods_instock_list'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'name' => array('required'=>'false','type'=>'string','name'=>'货品名称'),
                'bn' => array('required'=>'false','type'=>'string','name'=>'货品编号'),
                'nPage' => array('required'=>'false','type'=>'int','name'=>'页码'),
            ),
            'set_goods_instock_status'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'goods_id' => array('required'=>'true','type'=>'string','name'=>'商品id'),
                'product_id' => array('required'=>'true','type'=>'string','name'=>'货品id'),
                'status' => array('required'=>'true','type'=>'string','name'=>'上下架状态'),
            ),
            'substore_favorite'=>array(
                'login_token'=> array('required'=>'true','type'=>'string','name'=>'登录token'),
                'goods_bn' => array('required'=>'false','type'=>'string','name'=>'商品编号'),
                'goods_name' => array('required'=>'false','type'=>'string','name'=>'商品名称'),
                'store_name' => array('required'=>'false','type'=>'string','name'=>'经销商名称'),
            ),
            'sub_goods_instock'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'store_name'=> array('required'=>'false','type'=>'string','name'=>'经销商名称'),
                'bn' => array('required'=>'false','type'=>'string','name'=>'产品编号'),
                'goods_name' => array('required'=>'false','type'=>'string','name'=>'产品名称'),
            ),
            'store_goods_list'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'search_content'=> array('required'=>'false','type'=>'string','name'=>'搜索内容'),
                'hide_no_store'=>array('required'=>'false','type'=>'string','name'=>'隐藏零库存'),
                'npage' => array('required'=>'false','type'=>'number','name'=>'页码'),
                'pagesize' => array('required'=>'false','type'=>'number','name'=>'页码大小'),
            ),
            'store_goods_detail'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'store_id'=> array('required'=>'true','type'=>'string','name'=>'店铺ID'),
                'product_id'=> array('required'=>'true','type'=>'string','name'=>'货品ID'),
                'npage' => array('required'=>'false','type'=>'number','name'=>'页码'),
                'pagesize' => array('required'=>'false','type'=>'number','name'=>'页码大小'),
            ),
            'set_sub_price'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'product_id'=> array('required'=>'true','type'=>'string','name'=>'货品ID'),
				'subinfo' => array('required'=>'true','type'=>'json','name'=>'下级采购价',
						'items'=>array(
							'grade_id'=>array('required'=>'true','type'=>'string','name'=>'等级id'),
							'grade_name'=>array('required'=>'true','type'=>'string','name'=>'等级名称'),
							'subprice'=>array('required'=>'true','type'=>'string','name'=>'下级采购价'),
							'limit_price'=>array('required'=>'true','type'=>'string','name'=>'下级限价'),
						),
					),
            ),

            'adjust_number_onsale'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'product_id'=> array('required'=>'true','type'=>'string','name'=>'货品ID'),
                'num' => array('required'=>'true','type'=>'number','name'=>'上架数量'),
            ),
            'goods_substore_purchase_scope'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'goods_id'=> array('required'=>'false','type'=>'string','name'=>'商品ID'),
                'npage'=> array('required'=>'false','type'=>'string','name'=>'分页'),
                'pagesize'=> array('required'=>'false','type'=>'string','name'=>'分页大小'),
            ),
            'set_goods_substore_purchase'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'goods_id'=> array('required'=>'true','type'=>'string','name'=>'商品ID'),
                'content'=> array('required'=>'true','type'=>'json','name'=>'经销商授权键值对',
                    'items'=>array(
                        'store_id'=>array('required'=>'true','type'=>'string','name'=>'经销商ID'),
                        'status'=>array('required'=>'true','type'=>'string','name'=>'授权状态'),
                    ),
                ),
            ),
            'sub_store_goods_list'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'search_content'=> array('required'=>'false','type'=>'string','name'=>'搜索内容'),
                'hide_no_store'=>array('required'=>'false','type'=>'string','name'=>'隐藏零库存'),
                'npage' => array('required'=>'false','type'=>'number','name'=>'页码'),
                'pagesize' => array('required'=>'false','type'=>'number','name'=>'页码大小'),
            ),
            'sub_store_goods_detail'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'store_id'=> array('required'=>'true','type'=>'string','name'=>'店铺ID'),
                'product_id'=> array('required'=>'true','type'=>'string','name'=>'货品ID'),
                'npage' => array('required'=>'false','type'=>'number','name'=>'页码'),
                'pagesize' => array('required'=>'false','type'=>'number','name'=>'页码大小'),
            ),
            'store_info'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'store_id'=> array('required'=>'true','type'=>'string','name'=>'店铺ID'),
            ),
            'sub_onsale_order'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'store_id'=> array('required'=>'true','type'=>'string','name'=>'店铺ID'),
                'gbn'=>array('required'=>'true','type'=>'string','name'=>'商品编号'),
                'npage' => array('required'=>'false','type'=>'number','name'=>'页码'),
            ),
            'salesmanlist'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'status'=> array('required'=>'false','type'=>'string','name'=>'审核状态'),
                'npage' => array('required'=>'false','type'=>'number','name'=>'页码'),
                'pagesize' => array('required'=>'false','type'=>'number','name'=>'页码大小'),
            ),
            'sub_onpurchase_order'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'store_id'=> array('required'=>'false','type'=>'string','name'=>'经销商ID'),
                'goods_bn'=> array('required'=>'true','type'=>'string','name'=>'商品编号'),
                'page_no' => array('required'=>'false','type'=>'number','name'=>'页码'),
            ),
            'orderdetail'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'order_id'=>array('required'=>'true','type'=>'string','name'=>'订单ID'),
            ),
            'prepare_order_approve'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'order_id'=>array('required'=>'true','type'=>'string','name'=>'订单ID'),
            ),
            'offline_order'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'issale'=> array('required' =>'false','type'=>'string','name'=>'是否是销售订单' ),
                'nPage' => array('required'=>'false','type'=>'number','name'=>'页码'),
            ),
            'add_offline_order'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'issale'=> array('required' =>'false','type'=>'string','name'=>'是否是销售订单' ),
            ),
            'save_offline_order'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'issale'=> array('required' =>'true','type'=>'string','name'=>'是否是销售订单' ),
                'goods'=>array('required'=>'true','type'=>'json','name'=>'商品信息',
                    'items'=>array(
                        'pid'=>array('required'=>'true','type'=>'string','name'=>'货品ID'),
                        'num'=>array('required'=>'true','type'=>'string','name'=>'数量'),
                        'price'=>array('required'=>'true','type'=>'string','name'=>'价格'),
                    ),
                ),
                'totalprice'=>array('required'=>'true','type'=>'number','name'=>'总金额'),
                'createtime'=>array('required'=>'false','type'=>'string','name'=>'时间'),
                'memo'=>array('required'=>'false','type'=>'string','name'=>'备注'),
            ),
        );

        return $params[$method];
    }
    
    public function description($method){
        $description = array(
            'goods_order_list'=>array(
                'name'        =>'获取采购商品列表',
                'description' =>'获取采购商品列表接口',
            ),
            'substore_purchase_scope'=>array(
                'name'        =>'下级经销商授权列表',
                'description' =>'获取可授权下级经销商列表接口',
            ),
            'godelivery'=>array(
                'name'        =>'卖家发货',
                'description' =>'卖家发货接口',
            ),
            'dodelivery'=>array(
                'name'        =>'卖家提交发货',
                'description' =>'卖家提交发货接口',
            ),
            'substore_purchase_price'=>array(
                'name'        =>'下级经销商采购价列表',
                'description' =>'获取下级经销商采购价列表接口',
            ),
            'set_substore_purchase_price'=>array(
                'name'        =>'修改下级经销商采购价',
                'description' =>'修改下级经销商采购价接口',
            ),
            'substore_approve_list'=>array(
                'name'        =>'下级经销商审核列表',
                'description' =>'下级经销商审核列表接口',
            ),
            'substore_approve_detail'=>array(
                'name'        =>'下级经销商审核详细内容',
                'description' =>'下级经销商审核详细内容接口',
            ),
            'substore_approve'=>array(
                'name'        =>'下级经销商审核',
                'description' =>'下级经销商审核接口',
            ),
            'order_to_ship'=>array(
                'name'        =>'待发货订单',
                'description' =>'待发货订单',
            ),
            'order_nopayed'=>array(
                'name'        =>'待收款订单',
                'description' =>'待收款订单',
            ),
            'order_docancel'=>array(
                'name'        =>'取消待收款订单',
                'description' =>'取消待收款订单',
            ),
            'divideShop' => array(
                'name'        =>'提交采购权限',
                'description' =>'提交采购权限接口',
            ),
            'change_price_before' => array(
                'name'        =>'获取订单价格信息',
                'description' =>'获取订单价格信息',
            ),
            'change_price' => array(
                'name'        =>'卖家修改价格',
                'description' =>'卖家修改价格',
            ),
            'goods_instock_list' => array(
                'name'        =>'商品库存',
                'description' =>'商品库存接口',
            ),
            'set_goods_instock_status' => array(
                'name'        =>'商品上下架',
                'description' =>'商品上下架接口',
            ),
            'substore_favorite' => array(
                'name'        =>'下级经销商心愿单',
                'description' =>'下级经销商心愿单接口',                
            ),
            'sub_goods_instock' => array(
                'name'        =>'下级经销商库存',
                'description' =>'下级经销商库存接口',                
            ),
            'store_goods_list' => array(
                'name'        =>'库存商品管理',
                'description' =>'库存商品管理接口',                
            ),
            'store_goods_detail' => array(
                'name'        =>'商品库存明细账',
                'description' =>'商品库存明细账',                
            ),
            'set_sub_price' => array(
                'name'        =>'设置商品下级采购价',
                'description' =>'设置商品下级采购价',                
            ),
            'adjust_number_onsale' => array(
                'name'        =>'调整商品上架数量',
                'description' =>'调整商品上架数量',                
            ),
            'goods_substore_purchase_scope' => array(
                'name'        =>'某商品下级经销商采购权限',
                'description' =>'某商品下级经销商采购权限',                
            ),
            'set_goods_substore_purchase' => array(
                'name'        =>'保存某商品下级经销商采购权限',
                'description' =>'保存某商品下级经销商采购权限',                
            ),
            'sub_store_goods_list' => array(
                'name'        =>'下级库存商品管理',
                'description' =>'下级库存商品管理接口',                
            ),
            'sub_store_goods_detail' => array(
                'name'        =>'下级库存商品明细账',
                'description' =>'下级库存商品明细账接口',                
            ),
            'store_info' => array(
                'name'        =>'经销商信息',
                'description' =>'经销商信息',                
            ),
            'sub_onsale_order' => array(
                'name'        =>'下级销售在途订单',
                'description' =>'下级销售在途订单', 
            ),             
            'salesmanlist' => array(
                'name'        =>'促销员列表',
                'description' =>'促销员列表接口',                
            ),
            'sub_onpurchase_order' => array(
                'name'        =>'下级经销商采购在途',
                'description' =>'下级经销商采购在途订单',                
            ),
            'orderdetail' => array(
                'name'        =>'订单详情',
                'description' =>'订单详情',                
            ),
            'prepare_order_approve' => array(
                'name'        =>'预售订单审核',
                'description' =>'预售订单审核',                
            ),
            'offline_order' => array(
                'name'        =>'线下采购销售单',
                'description' =>'线下采购销售单',     
            ),
            'add_offline_order'=>array(
                'name'        =>'新增线下订单',
                'description' =>'新增线下订单',
            ),
            'save_offline_order'=>array(
                'name'        =>'保存线下订单',
                'description' =>'保存线下订单',
            ),
        );
        return $description[$method];
    }

}